package com.company.control;

import com.company.bean.UserInfoBean;
import com.company.model.UserModel;
import com.company.util.Myutils;
import com.mysql.cj.protocol.a.MysqlBinaryValueDecoder;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;

@WebServlet(name = "ModifyJumpServlet", value = "/modifyJump")
public class ModifyJumpServlet extends HttpServlet {
    @Override
    protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        //获取需要修改数据记录的id值
        String strID = request.getParameter("id");
        //根据id查询数据记录
        UserInfoBean userInfoBean = Myutils.getNewIntance
                (UserModel.class).queryUserInfoById(strID);
        //缓存数据
        request.getSession().setAttribute("userInfoBean",userInfoBean);

        //跳转到修改页面
        request.getRequestDispatcher("WEB-INF/viewpages/userinfoB/UserInfoModify.jsp")
                .forward(request,response);

    }


}
